<?php

/**
 * winbinder 패키지 
 * 
 * 
 * @package php.ui.winbinder
 */

/**
 * WBImageButton 
 * 
 * @package php.ui.winbinder 
 */
class WBImageButton extends WBControl { 
	public function __construct($options = array()) { 
		$options['class'] = ImageButton;

		parent::__construct($options);
	}

	protected function initCreate() { 
		parent::initCreate();
		
		$style = $this->getOption('style');

		$style |= WBC_IMAGE;

		if (isset($this->transparent)) $style |= WBC_TRANSPARENT;
		if (isset($this->notify)) $style |= WBC_AUTOREPEAT;
		
		$this->setOption('style', $style);
	}

	// 객체 초기화 
	protected function initComponent() { 
		parent::initComponent();

		// 이미지 생성 
		if(isset($this->image)) $this->setImage($this->getOption('image'));

		if(isset($this->tooltip)) $this->setToolTip($this->getOption('tooltip'));
	}

	public function setToolTip($tooltip) { 
		$this->setText($tooltip);
	}
}

?>